﻿#ifndef DEFINE_H
#define DEFINE_H
#include <qobject.h>

#define sw32(A) ((((unsigned int)(A) & 0xff000000) >> 24) | (((unsigned int)(A) & 0x00ff0000) >> 8) | (((unsigned int)(A) & 0x0000ff00) << 8)|(((unsigned int)(A) & 0x000000ff) << 24))

#define sw16(x) ((unsigned short)(((( unsigned short)(x)&(unsigned short)0x00ffU)<<8)|(((unsigned short)(x)&(unsigned short)0xff00U)>>8)))

#define M_FRAME_TIME 10


typedef union _twochardata
{
    unsigned short ui16data;
    short           i16data;
    uchar data[2];
}twochar;

typedef union _fourchardata
{
    int i32data;
    unsigned int ui32data;
    unsigned short u16data[2];
    uchar data[4];
    float lfdata;
}fourchar;

typedef struct _param
{
    QString sParamName;
    float lfParamMin;
    float lfParamMax;
    float lfCoeff;
    QString sUnit;
    float lfdefaultdata;

    float lfcurrentSetdata;
}st_param;

typedef struct _workmodeParam
{
    QString sName;
    int paramCnt;
    st_param param1;
    st_param param2;
    st_param param3;

}st_workmodeParam;
#endif // DEFINE_H
